package verexcecoesruntime;

import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;


public class CriaViewVerExcecoesRuntime extends ViewPart 
{
	private org.eclipse.swt.widgets.Composite painelVerExcecoes;
	private static volatile CriaViewVerExcecoesRuntime singleton;
	public CriaViewVerExcecoesRuntime()
	{
		super();
	}
	
	public static synchronized CriaViewVerExcecoesRuntime getInstance()
	{
		if(singleton == null)
		{
			singleton = new CriaViewVerExcecoesRuntime();
		}
		
		return singleton;
	}
	

	@Override
	public void createPartControl(Composite parent) {
		/*painelVerExcecoes = new Group(parent, 0);
		Label label = new Label(painelVerExcecoes, 0);
		label.setText("hello world");
		label.setLocation(20,20);
		label.pack();
		Label label2 = new Label(painelVerExcecoes, 0);
		label.setLocation(20,45);
		label2.pack();
		label2.setText("hiya world!");
		painelVerExcecoes.pack();*/
		
		
		painelVerExcecoes = new Composite(parent, 0);
		painelVerExcecoes.setLayout(new GridLayout(1, true));
		Label label = new Label(painelVerExcecoes, 0);
		label.setText("hello world");
		
		label.pack();
		Label label2 = new Label(painelVerExcecoes, 0);
		
		label2.pack();
		label2.setText("hiya world!");
		painelVerExcecoes.pack();
		
		
		
	}
	
	public void adicionarTextoNaView(String texto)
	{
		Label label = new Label(painelVerExcecoes, 0);
		label.setText(texto);
		label.pack();
		painelVerExcecoes.pack();
	}

	@Override
	public void setFocus() {
		painelVerExcecoes.setFocus();
		
	}
	

}
